# -*- coding:utf-8 -*-
import sys  
reload(sys)  
sys.setdefaultencoding('utf8')
from django.contrib import admin
from mysite.admin import admin_site
from .models import Vehicle,Trip,Trace


class TraceInline(admin.TabularInline):
    model = Trace
    extra = 3
    #list_display = ('first_name', 'last_name', 'email')

    #list_display = ('full_name','address','tel')
    search_fields = ('Trip_id') 

    #"""docstring for TraceInLine"""
    #def __init__(self, arg):
    #    super(TraceInLine, self).__init__()
    #    self.arg = arg
#
    #def newtitle(self,obj):
    #    return "test"
    #newtitle.short_description = u'顺序'


class TripAdmin(admin.ModelAdmin):
    #fieldsets = [
    #    (None,               {'fields': ['Trip_text']}),
    #    ('Date information', {'fields': ['pub_date'], 'classes': ['collapse']}),
    #]
    inlines = [TraceInline]
    #list_display = ('Trip_text', 'pub_date', 'was_published_recently')
    #list_filter = ['pub_date']

#admin_site.register(Trip, TripAdmin)
#admin_site.register(Trace)
#admin_site.register(Vehicle)

admin.site.register(Trip, TripAdmin)
admin.site.register(Trace)
admin.site.register(Vehicle)